#include <57header.h>

int num = 0;

void *func(void *p){

    for(int i=0; i<10000000; i++){
        num++;
    }

    return NULL;
}
int main(int argc,char*argv[])
{
    struct timeval begin;
    gettimeofday(&begin, NULL);

    pthread_t son_id;
    pthread_create(&son_id, NULL, func, NULL);

    for(int i=0; i<10000000; i++){
        num++;
    }

    pthread_join(son_id, NULL);
    printf("num: %d \n", num);

    struct timeval end;
    gettimeofday(&end, NULL);
    printf("time: %ld \n",  (end.tv_sec -begin.tv_sec)*1000000 +(end.tv_usec - begin.tv_usec) );
    return 0;
}

